package com.itheima.d4_jdk8_time;

import java.time.ZoneId;
import java.time.ZonedDateTime;

public class Test3_ZoneId_ZoneDateTime {
    public static void main(String[] args) {
        //了解时区和带时区的时间
        //获取系统默认时区
        System.out.println(ZoneId.systemDefault());
        //获取指定时区
        ZoneId zone = ZoneId.of("Asia/Shanghai");

        System.out.println(ZoneId.getAvailableZoneIds());


        //带时区的日期时间
        ZonedDateTime zdt = ZonedDateTime.now(zone);
        System.out.println(zdt);
        //带时区的日期时间
        ZonedDateTime zdt2 = ZonedDateTime.of(2020, 12, 12, 12, 12, 12, 12, zone);
        System.out.println(zdt2);
    }
}
